package com.ant.storage.controller;


import com.ant.storage.common.ResultPage;
import com.ant.storage.common.ResultVo;
import com.ant.storage.dto.AccountNumberDto;
import com.ant.storage.pojo.AccountNumber;
import com.ant.storage.service.IAccountNumberService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author melon
 * @since 2024-06-05
 */
@RestController
@RequestMapping("/account-number")
public class AccountNumberController {

    @Autowired
    private IAccountNumberService accountNumberService;

    @ApiOperation(value = "获取账号信息列表")
    @GetMapping("/getAccountNumberList")
    public ResultPage getAccountNumberList(AccountNumberDto dto) {
        return ResultPage.success("获取成功", accountNumberService.queryList(dto));
    }


    @ApiOperation(value = "保存账号信息")
    @PostMapping("/saveAccountNumber")
    public ResultVo save(@RequestBody AccountNumber accountNumber) {
        accountNumberService.saveAccountNumber(accountNumber);
        return ResultVo.success("获取成功");
    }

}
